
import 'dart:convert';

import 'package:ichinesereader/models/knowledgeword/knowledgeWord.dart';

BookWordsResult bookWordsResultFromJson(String str) =>
    BookWordsResult.fromJson(json.decode(str));

String bookWordsResultToJson(BookWordsResult data) =>
    json.encode(data.toJson());

class BookWordsResult {
  BookWordsResult({
    this.status,
    this.message,
    this.result,
  });

  int? status;
  String? message;
  Result? result;

  factory BookWordsResult.fromJson(Map<String, dynamic> json) =>
      BookWordsResult(
        status: json["status"],
        message: json["message"],
        result: json["result"] != null ? Result.fromJson(json["result"]) : null,
      );

  Map<String, dynamic> toJson() => {
        "status": status,
        "message": message,
        "result": result != null ? result?.toJson() : null,
      };
}

class Result {
  Result({
    this.limit,
    this.count,
    this.page,
    this.list,
  });

  int? limit;
  int? count;
  int? page;
  List<KnowledgeWord>? list;

  factory Result.fromJson(Map<String, dynamic> json) => Result(
        limit: json["limit"],
        count: json["count"],
        page: json["page"],
        list: json["list"] != null
            ? List<KnowledgeWord>.from(json["list"].map((x) => KnowledgeWord.fromJson(x)))
            : null,
      );

  Map<String, dynamic> toJson() => {
        "limit": limit,
        "count": count,
        "page": page,
        "list": list != null
            ? List<dynamic>.from(list!.map((x) => x.toJson()))
            : null,
      };
}
